{eval include template($common_template_pluginid.':new/common/header');}

<div class="weui-cells_form" >
	<iframe style="display:none" name="myiframe" id="myiframe"></iframe>
	<form id="postform" name="postform" action="plugin.php?id=aljbd&act={$_GET['act']}" method="POST"  accept-charset="utf-8">
		<input type="hidden" name="formhash" value="{FORMHASH}">
		<input type="hidden" name="gid" value="{$_GET['gid']}">
		<input type="hidden" name="bid" value="{$bid}">
		<input type="hidden" name="aljbd_goods_token" value="{eval echo create_token('aljbd_goods_token');}">
		<input type="hidden" name="type" id="type" value="{$type}">
		<input type="hidden" name="subtype" id="subtype" value="{$subtype}">
		<input type="hidden" name="subtype3" id="subtype3" value="{$subtype3}">

		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s283}</label></div>
			<div class="weui-cell__bd">
				{eval echo dhtmlspecialchars($bd['name']);}
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s284}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" name="name" value="{$g['name']}" placeholder="{lang aljbd:addgoods_touch_1}" >
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:addgoods_touch_18}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" name="selling_point" value="{$g['selling_point']}" placeholder="{lang aljbd:addgoods_touch_19}" >
			</div>
		</div>
		<div class="weui-cell weui-cell_select weui-cell_select-after">
			<div class="weui-cell__hd">
				<label class="weui-label">{lang aljbd:addgoods_touch_12}</label>
			</div>
			<div class="weui-cell__bd">
				<select class="weui-select" name="state">
					<option value="0" {if !$g['state']}checked="checked"{/if}>{lang aljbd:addgoods_touch_13}</option>
					<option value="1" {if $g['state'] == 1}checked="checked"{/if}>{lang aljbd:addgoods_touch_14}</option>
				</select>
			</div>
		</div>
		<div class="weui-cell weui-cell_select weui-cell_select-after">
			<div class="weui-cell__hd">
				<label class="weui-label">{lang aljbd:addgoods_touch_20}</label>
			</div>
			<div class="weui-cell__bd">
				<select class="weui-select" name="category">
					<option value="0" {if !$g['category']}checked="checked"{/if}>{lang aljbd:addgoods_touch_21}</option>
					<option value="1" {if $g['category'] == 1}checked="checked"{/if}>{lang aljbd:addgoods_touch_22}</option>
				</select>
			</div>
		</div>
		<div class="weui-cell weui-cell_access">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s223}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" id='type-picker' value="{$default_type}"  placeholder="{lang aljbd:s224}"/>
			</div>
			<div class="weui-cell__ft"></div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s285}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" value="{$g['price1']}" name="price1"  placeholder="{lang aljbd:addgoods_touch_2}">
			</div>
			<div class="weui-cell__ft">{$price_symbol}</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s286}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" value="{$g['price2']}" name="price2"  placeholder="{lang aljbd:addgoods_touch_3}">
			</div>
			<div class="weui-cell__ft">{$price_symbol}</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:amount}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="tel" value="{$g['amount']}" name="amount"  placeholder="{lang aljbd:addgoods_touch_4}">
			</div>
			<div class="weui-cell__ft">{lang aljbd:addgoods_touch_10}</div>
		</div>
		<div class="weui-cell weui-cell_select weui-cell_select-after">
			<div class="weui-cell__hd">
				<label class="weui-label">{lang aljbd:addgoods_touch_15}</label>
			</div>
			<div class="weui-cell__bd">
				<select class="weui-select" name="fare_desc" id="fare_desc">
					{loop $fare_desc $k $v}
					<option {if $g[fare_desc] == $k && $g[fare_desc]!='999999'}selected{/if}value="$k">$v
					{/loop}
					<option value="999999" {if $g[fare_desc]=='999999'}selected{/if}>{lang aljbd:addgoods_touch_16}
				</select>
			</div>
		</div>
		<div class="weui-cell" {if $g[fare_desc]!='999999'}style="display:none"{/if} id="fare">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:addgoods_touch_17}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="tel" value="{$g['fare']}" name="fare"  placeholder="{lang aljbd:addgoods_touch_5}">
			</div>
			<div class="weui-cell__ft">{$price_symbol}</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label  class="weui-label">{lang aljbd:tg112}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input time_Picker" name="endtime" type="text" placeholder="{lang aljbd:addgoods_touch_6}" value="{if $g['endtime']}{eval echo gmdate('Y-m-d H:i',$g['endtime']+8*3600);}{/if}" readonly="">
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__bd">
				<div class="weui-uploader">
					<div class="weui-uploader__hd">
						<p class="weui-uploader__title">{lang aljbd:addgoods_touch_7}</p>
						<div class="weui-uploader__info">{lang aljbd:addgoods_touch_8}</div>
					</div>
					<div class="weui-uploader__bd">
						<ul class="weui-uploader__files" id="uploaderFiles">
							{eval $shoppic = array('pic1','pic2','pic3','pic4','pic5');}
							{loop $shoppic $v}
							{if file_exists($g[$v])}
							<li class="weui-uploader__file weui-uploader__file_status img_list" style="background-image:url('{$g[$v]}')">
								<div class="weui-uploader__file-content">
									<i class="weui-icon-cancel" onclick="delimg(this)"></i>
								</div>
							</li>
							<input name="pic[]" class="pic" type="hidden" value="{$g[$v]}">
							{/if}
							{/loop}
						</ul>
						<div class="weui-uploader__input-box" >
							<input id="uploaderInput" class="weui-uploader__input" type="file"  onchange="lrz_mobile(this,5)">
						</div>
					</div>
				</div>
			</div>
		</div>
		{if !$settings['good_wurl']['value'] && !file_exists("source/plugin/dz_1/dz_1.inc.php")}
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:wurl_1}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text"  placeholder="{lang aljbd:wurl_2}" name="gwurl" value="{$g['gwurl']}">
			</div>
		</div>
		{/if}
		<div class="weui-cells weui-cells_form" style="margin-top: 0px">
			<div class="weui-cell">
				<div class="weui-cell__bd">
					<textarea class="weui-textarea" name="intro" placeholder="{lang aljbd:addgoods_touch_9}" rows="3">{$g['intro']}</textarea>
				</div>
			</div>
		</div>
		<div class="weui-btn-area">
			<button class="weui-btn weui-btn_primary" name="submit" type="submit" value="Y" onclick="$.showLoading();">{lang aljbd:sj_dianping_12}</button>
		</div>
	</form>
</div>
<script>
    $('#fare_desc').change(function() {
        if($("#fare_desc").val()=='999999'){
            $("#fare").show();
        }else{
            $("#fare").hide();
        }
    });
    +function($){
        $.rawtypeData = $typejson;
    }($);
</script>
<script src="{$common_path}/static/weui/js/type-picker.min.js" charset="utf-8"></script>
<script>
    $("#type-picker").cityPicker({
        title: "{lang aljbd:addgoods_touch_11}",
        onChange: function (picker, values, displayValues) {
            console.log(values);
            $('#type').val(values[0]);
            $('#subtype').val(values[1]);
            if(values[1] == values[2]){
                $('#subtype3').val('');
            }else{
                $('#subtype3').val(values[2]);
            }
        }
    });
</script>

{eval include template($common_template_pluginid.':new/common/footer');}